home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / demos / howtoskinacat / titlepic / titlepicture.s < prev   
Text File  |  1980-01-03  |  9KB  |  506 lines

  1. ùúùúÿËGgÿËGgÿËGgÿËGgÿËGgÿËGgÿËGgÿËGgÿËGgRaster=0
  2.  
  3. Track=1        ;0=ASM-One version
  4.         ;1=Track version
  5.  
  6. MyDmacon=%01111101111
  7. ;      abcdefghhhh
  8. ; a = Blitter nasty
  9. ; b = Enable DMA activity (always set this!)
  10. ; c = Bitplane enable
  11. ; d = Copper enable
  12. ; e = Blitter enable
  13. ; f = Sprite enable
  14. ; g = Disk enable
  15. ; h = Audio channels enable
  16.  
  17. MyIntena=%100000000100000
  18. ;      abcdeeeefghijkl
  19. ; a = Enable interrupts
  20. ; b = Lev. 6 External interrupt
  21. ; c = Lev. 5 Disk sync found
  22. ; d = Lev. 5 Serial port receive buffer full
  23. ; e = Lev. 4 Audio ch. 3-0 block finished
  24. ; f = Lev. 3 Blitter finished
  25. ; g = Lev. 3 Vertical blank
  26. ; h = Lev. 3 Copper
  27. ; i = Lev. 2 I/O Ports and timers
  28. ; j = Lev. 1 Software
  29. ; k = Lev. 1 Disk block finished
  30. ; l = Lev. 1 Serial port transmit buffer empty
  31.  
  32.         IFEQ    Track-1
  33.         ORG    $60000
  34.         LOAD    $1E0000
  35.  
  36.         AUTO    WS\$1E0000\1672\82\
  37.         ELSE
  38.         SECTION    Kode,code_c
  39.         ENDC
  40.  
  41.  
  42.         JumpPtr    Begin
  43.  
  44. *******************************************************************************
  45. **Macros
  46. *******************************************************************************
  47. WaitBlt:    macro
  48. .vent\@:    btst    #14,$dff002
  49.         bne    .vent\@
  50.         endm
  51.  
  52. *******************************************************************************
  53. **Initialisering
  54. *******************************************************************************
  55. Begin:
  56.         IF    Track=0
  57.         move.w    Intenar+Base,OldIntena
  58.         move.w    Dmacon+Base,OldDmacon
  59.         move.w    #$7fff,Intena+Base
  60.         move.w    #$7fff,Dmacon+Base
  61.         move.w    #$7fff,Intreq+Base
  62.  
  63.         move.l    (Lev3Base).w,OldIrq3
  64.         ELSE
  65.         move.l    #Lev3Irq,(Lev1Base).w
  66.         rts
  67.         ENDC
  68.  
  69.  
  70.         lea    Planer+2,a0
  71.         move.l    #(Pic+32+0*40),d0
  72.         moveq    #4-1,d1
  73. .loop        move.w    d0,4(a0)
  74.         swap    d0
  75.         move.w    d0,(a0)
  76.         swap    d0
  77.         add.l    #40,d0
  78.         addq.w    #8,a0
  79.         dbra    d1,.loop
  80.  
  81.  
  82.         IF    Track=0
  83.         move.l    #Lev3Irq,(Lev3Base).w
  84.         waitblt
  85.  
  86.         move.w    #MyDmacon+$8000,Dmacon+Base
  87.         move.w    #MyIntena+$8000,Intena+Base
  88.  
  89. Wait:
  90.         move.w    IWantOut(pc),d0
  91.         beq.b    wait
  92.  
  93. *******************************************************************************
  94. **Exit to AmigaDOS
  95. *******************************************************************************
  96. ExitToDos:
  97.         move.w    #$7fff,Intena+Base
  98.         move.w    #$7fff,Dmacon+Base
  99.         ENDC
  100.         rts
  101.  
  102. VBlank:        dc.w    0
  103.         IF    Track=0
  104. OldIntena:    dc.w    0
  105. OldDmacon:    dc.w    0
  106. OldIrq3:    dc.l    0
  107. IWantOut:    dc.w    0
  108.         ELSE
  109. IWantOut:    EQU    $80
  110.         ENDC
  111. MegaPause:    dc.w    500
  112.  
  113. *******************************************************************************
  114. **Level 3 interrupt
  115. *******************************************************************************
  116. Lev3Irq:
  117.         movem.l    d0-a6,-(sp)
  118.         move.l    #Copper,Cop2lch+Base
  119.         move.w    d0,Copjmp2+Base
  120.         move.w    #1,VBlank
  121. *******************************************************************************
  122.         bsr    Faders
  123.         cmp.w    #3,Story
  124.         bne.b    .NoLeft
  125. *******************************************************************************
  126.         move.w    #-1,IWantOut
  127. .NoLeft:    if    Raster=1
  128.         move.w    #$f00,Color00+Base
  129.         endif
  130.         waitblt
  131.         if    Raster=1
  132.         move.w    #$00f,Color00+Base
  133.         endif
  134.         movem.l    (sp)+,d0-a6
  135.         IFEQ    Track-0
  136.         move.w    #$0020,Intreq+Base
  137.         ELSE
  138.         move.w    #$0004,Intreq+Base
  139.         ENDC
  140.         rte
  141.  
  142.  
  143. Faders:        move.w    Story(pc),d0
  144.         beq    FadeUp
  145.         subq.w    #1,d0
  146.         beq    CountDown
  147.         subq.w    #1,d0
  148.         beq    FadeDn
  149.         rts
  150.  
  151. CountDown:    subq.w    #1,MegaPause
  152.         bne.b    .ud
  153.         addq.w    #1,Story
  154. .ud:        rts
  155.  
  156. *******************************************************************************
  157. **FadeUpDn
  158. *******************************************************************************
  159. Story:        dc.w    0
  160. FadeUp:
  161.         lea    Colors+2,a0
  162.         lea    Pic,a1
  163.         moveq    #16-1,d7
  164.         moveq    #0,d6
  165. .loop:        move.w    (a0),d0
  166.         move.w    (a1)+,d1
  167.         bsr    fader
  168.         move.w    d0,(a0)
  169.         cmp.w    d0,d1
  170.         bne    .notens
  171.         addq.w    #1,d6
  172. .notens:    addq.w    #4,a0
  173.         dbra    d7,.loop
  174.         cmp.w    #16,d6
  175.         bne    .ud
  176.         addq.w    #1,Story
  177. .ud:        rts
  178.  
  179. FadeDn:
  180.         lea    Colors+2,a0
  181.         moveq    #16-1,d7
  182.         moveq    #0,d6
  183. .loop:        move.w    (a0),d0
  184.         moveq    #0,d1
  185.         bsr    fader
  186.         move.w    d0,(a0)
  187.         cmp.w    d0,d1
  188.         bne    .notens
  189.         addq.w    #1,d6
  190. .notens:    addq.w    #4,a0
  191.         dbra    d7,.loop
  192.         cmp.w    #16,d6
  193.         bne    .ud
  194.         addq.w    #1,Story
  195. .ud:        rts
  196.  
  197. **d0=fade from
  198. **d1=fade to
  199. **out: d0=newcol
  200. fader:        move.w    d0,d2
  201.         move.w    d1,d3
  202.         lsr.w    #8,d2
  203.         lsr.w    #8,d3
  204.         cmp.w    d2,d3
  205.         beq    .nored
  206.         blt    .redsub
  207.         add.w    #$100,d0
  208.         bra    .nored
  209. .redsub:    sub.w    #$100,d0
  210. .nored:        move.w    d0,d2
  211.         move.w    d1,d3
  212.         lsr.w    #4,d2
  213.         lsr.w    #4,d3
  214.         and.w    #$f,d2
  215.         and.w    #$f,d3
  216.         cmp.w    d2,d3
  217.         beq    .nogreen
  218.         blt    .greensub
  219.         add.w    #$10,d0
  220.         bra    .nogreen
  221. .greensub:    sub.w    #$10,d0
  222. .nogreen:    move.w    d0,d2
  223.         move.w    d1,d3
  224.         and.w    #$f,d2
  225.         and.w    #$f,d3
  226.         cmp.w    d2,d3
  227.         beq    .noblue
  228.         blt    .bluesub
  229.         addq.w    #$1,d0
  230.         bra    .noblue
  231. .bluesub:    subq.w    #$1,d0
  232. .noblue:    rts
  233.  
  234. *******************************************************************************
  235. **Copperlist
  236. *******************************************************************************
  237. Copper:
  238.         dc.w    Spr0pth,$0000
  239.         dc.w    Spr0ptl,$0000
  240.         dc.w    Spr1pth,$0000
  241.         dc.w    Spr1ptl,$0000
  242.         dc.w    Spr2pth,$0000
  243.         dc.w    Spr2ptl,$0000
  244.         dc.w    Spr3pth,$0000
  245.         dc.w    Spr3ptl,$0000
  246.         dc.w    Spr4pth,$0000
  247.         dc.w    Spr4ptl,$0000
  248.         dc.w    Spr5pth,$0000
  249.         dc.w    Spr5ptl,$0000
  250.         dc.w    Spr6pth,$0000
  251.         dc.w    Spr6ptl,$0000
  252.         dc.w    Spr7pth,$0000
  253.         dc.w    Spr7ptl,$0000
  254.  
  255.         dc.w    Diwstrt,$2c81
  256.         dc.w    Diwstop,$2cc1
  257.         dc.w    Ddfstrt,$0038
  258.         dc.w    Ddfstop,$00d0
  259.  
  260.         dc.w    $106,$0c40
  261.  
  262. Colors:    dc.w    $0180,$000,$0182,$000,$0184,$000,$0186,$000
  263.     dc.w    $0188,$000,$018a,$000,$018c,$000,$018e,$000
  264.     dc.w    $0190,$000,$0192,$000,$0194,$000,$0196,$000
  265.     dc.w    $0198,$000,$019a,$000,$019c,$000,$019e,$000
  266.  
  267.         dc.w    $1001,$fffe
  268. Planer:        dc.w    Bpl1pth,0    ;(Pic+32+0*40)>>16
  269.         dc.w    Bpl1ptl,0    ;(Pic+32+0*40)&$ffff
  270.         dc.w    Bpl2pth,0    ;(Pic+32+1*40)>>16
  271.         dc.w    Bpl2ptl,0    ;(Pic+32+1*40)&$ffff
  272.         dc.w    Bpl3pth,0    ;(Pic+32+2*40)>>16
  273.         dc.w    Bpl3ptl,0    ;(Pic+32+2*40)&$ffff
  274.         dc.w    Bpl4pth,0    ;(Pic+32+3*40)>>16
  275.         dc.w    Bpl4ptl,0    ;(Pic+32+3*40)&$ffff
  276.  
  277.         dc.w    Bpl1mod,3*40
  278.         dc.w    Bpl2mod,3*40
  279.  
  280.         dc.w    Bplcon0,$4200
  281.         dc.w    Bplcon1,$0000
  282.         dc.w    Bplcon2,$0024
  283.  
  284.         dc.w    $ffff,$fffe
  285.  
  286. *******************************************************************************
  287. **Screens+Gfx
  288. *******************************************************************************
  289.         INCDIR    "Work:Code/Sources/HTSAC/TitlePic/"
  290. Pic:        INCBIN    "TitlePic.blit4*320*256+cmap"
  291.  
  292. TheEnd:
  293.  
  294. *******************************************************************************
  295. **Hardware registers
  296. *******************************************************************************
  297. Bltddat=$000
  298. Dmaconr=$002
  299. Vposr=$004
  300. Vhposr=$006
  301. Dskdatr=$008
  302. Joy0dat=$00a
  303. Joy1dat=$00c
  304. Clxdat=$00e
  305. Adkconr=$010
  306. Pot0dat=$012
  307. Pot1dat=$014
  308. Potgor=$016
  309. Serdatr=$018
  310. Dskbytr=$01a
  311. Intenar=$01c
  312. Intreqr=$01e
  313. Dskpth=$020
  314. Dskptl=$022
  315. Dsklen=$024
  316. Dskdat=$026
  317. Refptr=$028
  318. Vposw=$02a
  319. Vhposw=$02c
  320. Copcon=$02e
  321. Serdat=$030
  322. Serper=$032
  323. Potgo=$034
  324. Joytest=$036
  325. Strequ=$038
  326. Strvbl=$03a
  327. Strhor=$03c
  328. Strlong=$03e
  329. Bltcon0=$040
  330. Bltcon1=$042
  331. Bltafwm=$044
  332. Bltalwm=$046
  333. Bltcpth=$048
  334. Bltcptl=$04a
  335. Bltbpth=$04c
  336. Bltbptl=$04e
  337. Bltapth=$050
  338. Bltaptl=$052
  339. Bltdpth=$054
  340. Bltdptl=$056
  341. Bltsize=$058
  342. Bltcmod=$060
  343. Bltbmod=$062
  344. Bltamod=$064
  345. Bltdmod=$066
  346. Bltcdat=$070
  347. Bltbdat=$072
  348. Bltadat=$074
  349. Dsksync=$07e
  350. Cop1lch=$080
  351. Cop1lcl=$082
  352. Cop2lch=$084
  353. Cop2lcl=$086
  354. Copjmp1=$088
  355. Copjmp2=$08a
  356. Copins=$08c
  357. Diwstrt=$08e
  358. Diwstop=$090
  359. Ddfstrt=$092
  360. Ddfstop=$094
  361. Dmacon=$096
  362. Clxcon=$98
  363. Intena=$09a
  364. Intreq=$09c
  365. Adkcon=$09e
  366. Aud0dat=$0aa
  367. Aud1dat=$0ba
  368. Aud2dat=$0ca
  369. Aud3dat=$0da
  370. Aud0lch=$0a0
  371. Aud1lch=$0b0
  372. Aud2lch=$0c0
  373. Aud3lch=$0d0
  374. Aud0len=$0a4
  375. Aud1len=$0b4
  376. Aud2len=$0c4
  377. Aud3len=$0d4
  378. Aud0per=$0a6
  379. Aud1per=$0b6
  380. Aud2per=$0c6
  381. Aud3per=$0d6
  382. Aud0vol=$0a8
  383. Aud1vol=$0b8
  384. Aud2vol=$0c8
  385. Aud3vol=$0d8
  386. Aud0lcl=$0a2
  387. Aud1lcl=$0b2
  388. Aud2lcl=$0c2
  389. Aud3lcl=$0d2
  390. Bpl1pth=$0e0
  391. Bpl1ptl=$0e2
  392. Bpl2pth=$0e4
  393. Bpl2ptl=$0e6
  394. Bpl3pth=$0e8
  395. Bpl3ptl=$0ea
  396. Bpl4pth=$0ec
  397. Bpl4ptl=$0ee
  398. Bpl5pth=$0f0
  399. Bpl5ptl=$0f2
  400. Bpl6pth=$0f4
  401. Bpl6ptl=$0f6
  402. Bplcon0=$100
  403. Bplcon1=$102
  404. Bplcon2=$104
  405. Bpl1mod=$108
  406. Bpl2mod=$10a
  407. Bpl1dat=$110
  408. Bpl2dat=$112
  409. Bpl3dat=$114
  410. Bpl4dat=$116
  411. Bpl5dat=$118
  412. Bpl6dat=$11a
  413. Spr0pth=$120
  414. Spr0ptl=$122
  415. Spr1pth=$124
  416. Spr1ptl=$126
  417. Spr2pth=$128
  418. Spr2ptl=$12a
  419. Spr3pth=$12c
  420. Spr3ptl=$12e
  421. Spr4pth=$130
  422. Spr4ptl=$132
  423. Spr5pth=$134
  424. Spr5ptl=$136
  425. Spr6pth=$138
  426. Spr6ptl=$13a
  427. Spr7pth=$13c
  428. Spr7ptl=$13e
  429. Spr0pos=$140
  430. Spr0ctl=$142
  431. Spr0data=$144
  432. Spr0datb=$146
  433. Spr1pos=$148
  434. Spr1ctl=$14a
  435. Spr1data=$14c
  436. Spr1datb=$14e
  437. Spr2pos=$150
  438. Spr2ctl=$152
  439. Spr2data=$154
  440. Spr2datb=$156
  441. Spr3pos=$158
  442. Spr3ctl=$15a
  443. Spr3data=$15c
  444. Spr3datb=$15e
  445. Spr4pos=$160
  446. Spr4ctl=$162
  447. Spr4data=$164
  448. Spr4datb=$166
  449. Spr5pos=$168
  450. Spr5ctl=$16a
  451. Spr5data=$16c
  452. Spr5datb=$16e
  453. Spr6pos=$170
  454. Spr6ctl=$172
  455. Spr6data=$174
  456. Spr6datb=$176
  457. Spr7pos=$178
  458. Spr7ctl=$17a
  459. Spr7data=$17c
  460. Spr7datb=$17e
  461. Color00=$180
  462. Color01=$182
  463. Color02=$184
  464. Color03=$186
  465. Color04=$188
  466. Color05=$18a
  467. Color06=$18c
  468. Color07=$18e
  469. Color08=$190
  470. Color09=$192
  471. Color10=$194
  472. Color11=$196
  473. Color12=$198
  474. Color13=$19a
  475. Color14=$19c
  476. Color15=$19e
  477. Color16=$1a0
  478. Color17=$1a2
  479. Color18=$1a4
  480. Color19=$1a6
  481. Color20=$1a8
  482. Color21=$1aa
  483. Color22=$1ac
  484. Color23=$1ae
  485. Color24=$1b0
  486. Color25=$1b2
  487. Color26=$1b4
  488. Color27=$1b6
  489. Color28=$1b8
  490. Color29=$1ba
  491. Color30=$1bc
  492. Color31=$1be
  493. Base=$dff000
  494.  
  495. *******************************************************************************
  496. **Interrupt addresses
  497. *******************************************************************************
  498. Lev1Base=$64
  499. Lev2Base=$68
  500. Lev3Base=$6c
  501. Lev4Base=$70
  502. Lev5Base=$74
  503. Lev6Base=$78
  504. Lev7Base=$7c
  505.  
  506.